<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * pelamarkursus.php
 * @author ranuandra
 *
 * 7 Jun 2012 14:16:55
 *
 * 
 */

class Model_Pelamarkursus extends ORM
{
	protected $_belons_to = array(
	        'mstpelamar' 		=> array('model'	 => 'mstpelamar'),
	);
	
	private $_field = array('nama_training', 'lembaga', 'lokasi', 'tgl_mulai', 'tgl_selesai', 'flag_sertifikat');
	private $_form = array('nama_training' 				=> '', 
							'lembaga'					=> '',
							'lokasi'					=> '',
							'tgl_mulai'					=> '',
							'tgl_selesai'				=> '',
							'flag_sertifikat'			=> '',
	                      );
	
	public $rules = array(
					'nama_training' 	 => array(
									array('min_length', array(':value', 0)),
								),
					'lembaga' => array(
									array('min_length', array(':value', 0)),
								),
					'lokasi' => array(
									array('min_length', array(':value', 0)),
								),
					'tgl_mulai' => array(
									array('min_length', array(':value', 0)),
								),
					'tgl_selsai' => array(
									array('min_length', array(':value', 0)),
								),
					'flag_sertifikat' => array(
									array('min_length', array(':value', 0)),
								),
	);
	
	public function getField()
	{
		return $this->_field;
	}
	
	public function getForm()
	{
		return $this->_form;
		
	}
	
	public function create_data($values)
	{
	    return $this->values($values, $this->_field)->create();
	}	
}